
objdump:     file format elf64-x86-64


Disassembly of section .init:

00000000004008a8 <_init>:
  4008a8:	48 83 ec 08          	sub    $0x8,%rsp
  4008ac:	48 8b 05 45 17 20 00 	mov    0x201745(%rip),%rax        # 601ff8 <_DYNAMIC+0x1d0>
  4008b3:	48 85 c0             	test   %rax,%rax
  4008b6:	74 05                	je     4008bd <_init+0x15>
  4008b8:	e8 a3 00 00 00       	callq  400960 <__gmon_start__@plt>
  4008bd:	48 83 c4 08          	add    $0x8,%rsp
  4008c1:	c3                   	retq   

Disassembly of section .plt:

00000000004008d0 <raise@plt-0x10>:
  4008d0:	ff 35 32 17 20 00    	pushq  0x201732(%rip)        # 602008 <_GLOBAL_OFFSET_TABLE_+0x8>
  4008d6:	ff 25 34 17 20 00    	jmpq   *0x201734(%rip)        # 602010 <_GLOBAL_OFFSET_TABLE_+0x10>
  4008dc:	0f 1f 40 00          	nopl   0x0(%rax)

00000000004008e0 <raise@plt>:
  4008e0:	ff 25 32 17 20 00    	jmpq   *0x201732(%rip)        # 602018 <_GLOBAL_OFFSET_TABLE_+0x18>
  4008e6:	68 00 00 00 00       	pushq  $0x0
  4008eb:	e9 e0 ff ff ff       	jmpq   4008d0 <_init+0x28>

00000000004008f0 <free@plt>:
  4008f0:	ff 25 2a 17 20 00    	jmpq   *0x20172a(%rip)        # 602020 <_GLOBAL_OFFSET_TABLE_+0x20>
  4008f6:	68 01 00 00 00       	pushq  $0x1
  4008fb:	e9 d0 ff ff ff       	jmpq   4008d0 <_init+0x28>

0000000000400900 <puts@plt>:
  400900:	ff 25 22 17 20 00    	jmpq   *0x201722(%rip)        # 602028 <_GLOBAL_OFFSET_TABLE_+0x28>
  400906:	68 02 00 00 00       	pushq  $0x2
  40090b:	e9 c0 ff ff ff       	jmpq   4008d0 <_init+0x28>

0000000000400910 <backtrace_symbols@plt>:
  400910:	ff 25 1a 17 20 00    	jmpq   *0x20171a(%rip)        # 602030 <_GLOBAL_OFFSET_TABLE_+0x30>
  400916:	68 03 00 00 00       	pushq  $0x3
  40091b:	e9 b0 ff ff ff       	jmpq   4008d0 <_init+0x28>

0000000000400920 <backtrace@plt>:
  400920:	ff 25 12 17 20 00    	jmpq   *0x201712(%rip)        # 602038 <_GLOBAL_OFFSET_TABLE_+0x38>
  400926:	68 04 00 00 00       	pushq  $0x4
  40092b:	e9 a0 ff ff ff       	jmpq   4008d0 <_init+0x28>

0000000000400930 <printf@plt>:
  400930:	ff 25 0a 17 20 00    	jmpq   *0x20170a(%rip)        # 602040 <_GLOBAL_OFFSET_TABLE_+0x40>
  400936:	68 05 00 00 00       	pushq  $0x5
  40093b:	e9 90 ff ff ff       	jmpq   4008d0 <_init+0x28>

0000000000400940 <__libc_start_main@plt>:
  400940:	ff 25 02 17 20 00    	jmpq   *0x201702(%rip)        # 602048 <_GLOBAL_OFFSET_TABLE_+0x48>
  400946:	68 06 00 00 00       	pushq  $0x6
  40094b:	e9 80 ff ff ff       	jmpq   4008d0 <_init+0x28>

0000000000400950 <signal@plt>:
  400950:	ff 25 fa 16 20 00    	jmpq   *0x2016fa(%rip)        # 602050 <_GLOBAL_OFFSET_TABLE_+0x50>
  400956:	68 07 00 00 00       	pushq  $0x7
  40095b:	e9 70 ff ff ff       	jmpq   4008d0 <_init+0x28>

0000000000400960 <__gmon_start__@plt>:
  400960:	ff 25 f2 16 20 00    	jmpq   *0x2016f2(%rip)        # 602058 <_GLOBAL_OFFSET_TABLE_+0x58>
  400966:	68 08 00 00 00       	pushq  $0x8
  40096b:	e9 60 ff ff ff       	jmpq   4008d0 <_init+0x28>

0000000000400970 <perror@plt>:
  400970:	ff 25 ea 16 20 00    	jmpq   *0x2016ea(%rip)        # 602060 <_GLOBAL_OFFSET_TABLE_+0x60>
  400976:	68 09 00 00 00       	pushq  $0x9
  40097b:	e9 50 ff ff ff       	jmpq   4008d0 <_init+0x28>

0000000000400980 <exit@plt>:
  400980:	ff 25 e2 16 20 00    	jmpq   *0x2016e2(%rip)        # 602068 <_GLOBAL_OFFSET_TABLE_+0x68>
  400986:	68 0a 00 00 00       	pushq  $0xa
  40098b:	e9 40 ff ff ff       	jmpq   4008d0 <_init+0x28>

Disassembly of section .text:

0000000000400990 <_start>:
  400990:	31 ed                	xor    %ebp,%ebp
  400992:	49 89 d1             	mov    %rdx,%r9
  400995:	5e                   	pop    %rsi
  400996:	48 89 e2             	mov    %rsp,%rdx
  400999:	48 83 e4 f0          	and    $0xfffffffffffffff0,%rsp
  40099d:	50                   	push   %rax
  40099e:	54                   	push   %rsp
  40099f:	49 c7 c0 70 0c 40 00 	mov    $0x400c70,%r8
  4009a6:	48 c7 c1 00 0c 40 00 	mov    $0x400c00,%rcx
  4009ad:	48 c7 c7 7d 0a 40 00 	mov    $0x400a7d,%rdi
  4009b4:	e8 87 ff ff ff       	callq  400940 <__libc_start_main@plt>
  4009b9:	f4                   	hlt    
  4009ba:	66 0f 1f 44 00 00    	nopw   0x0(%rax,%rax,1)

00000000004009c0 <deregister_tm_clones>:
  4009c0:	b8 87 20 60 00       	mov    $0x602087,%eax
  4009c5:	55                   	push   %rbp
  4009c6:	48 2d 80 20 60 00    	sub    $0x602080,%rax
  4009cc:	48 83 f8 0e          	cmp    $0xe,%rax
  4009d0:	48 89 e5             	mov    %rsp,%rbp
  4009d3:	77 02                	ja     4009d7 <deregister_tm_clones+0x17>
  4009d5:	5d                   	pop    %rbp
  4009d6:	c3                   	retq   
  4009d7:	b8 00 00 00 00       	mov    $0x0,%eax
  4009dc:	48 85 c0             	test   %rax,%rax
  4009df:	74 f4                	je     4009d5 <deregister_tm_clones+0x15>
  4009e1:	5d                   	pop    %rbp
  4009e2:	bf 80 20 60 00       	mov    $0x602080,%edi
  4009e7:	ff e0                	jmpq   *%rax
  4009e9:	0f 1f 80 00 00 00 00 	nopl   0x0(%rax)

00000000004009f0 <register_tm_clones>:
  4009f0:	b8 80 20 60 00       	mov    $0x602080,%eax
  4009f5:	55                   	push   %rbp
  4009f6:	48 2d 80 20 60 00    	sub    $0x602080,%rax
  4009fc:	48 c1 f8 03          	sar    $0x3,%rax
  400a00:	48 89 e5             	mov    %rsp,%rbp
  400a03:	48 89 c2             	mov    %rax,%rdx
  400a06:	48 c1 ea 3f          	shr    $0x3f,%rdx
  400a0a:	48 01 d0             	add    %rdx,%rax
  400a0d:	48 d1 f8             	sar    %rax
  400a10:	75 02                	jne    400a14 <register_tm_clones+0x24>
  400a12:	5d                   	pop    %rbp
  400a13:	c3                   	retq   
  400a14:	ba 00 00 00 00       	mov    $0x0,%edx
  400a19:	48 85 d2             	test   %rdx,%rdx
  400a1c:	74 f4                	je     400a12 <register_tm_clones+0x22>
  400a1e:	5d                   	pop    %rbp
  400a1f:	48 89 c6             	mov    %rax,%rsi
  400a22:	bf 80 20 60 00       	mov    $0x602080,%edi
  400a27:	ff e2                	jmpq   *%rdx
  400a29:	0f 1f 80 00 00 00 00 	nopl   0x0(%rax)

0000000000400a30 <__do_global_dtors_aux>:
  400a30:	80 3d 49 16 20 00 00 	cmpb   $0x0,0x201649(%rip)        # 602080 <_edata>
  400a37:	75 11                	jne    400a4a <__do_global_dtors_aux+0x1a>
  400a39:	55                   	push   %rbp
  400a3a:	48 89 e5             	mov    %rsp,%rbp
  400a3d:	e8 7e ff ff ff       	callq  4009c0 <deregister_tm_clones>
  400a42:	5d                   	pop    %rbp
  400a43:	c6 05 36 16 20 00 01 	movb   $0x1,0x201636(%rip)        # 602080 <_edata>
  400a4a:	f3 c3                	repz retq 
  400a4c:	0f 1f 40 00          	nopl   0x0(%rax)

0000000000400a50 <frame_dummy>:
  400a50:	48 83 3d c8 13 20 00 	cmpq   $0x0,0x2013c8(%rip)        # 601e20 <__JCR_END__>
  400a57:	00 
  400a58:	74 1e                	je     400a78 <frame_dummy+0x28>
  400a5a:	b8 00 00 00 00       	mov    $0x0,%eax
  400a5f:	48 85 c0             	test   %rax,%rax
  400a62:	74 14                	je     400a78 <frame_dummy+0x28>
  400a64:	55                   	push   %rbp
  400a65:	bf 20 1e 60 00       	mov    $0x601e20,%edi
  400a6a:	48 89 e5             	mov    %rsp,%rbp
  400a6d:	ff d0                	callq  *%rax
  400a6f:	5d                   	pop    %rbp
  400a70:	e9 7b ff ff ff       	jmpq   4009f0 <register_tm_clones>
  400a75:	0f 1f 00             	nopl   (%rax)
  400a78:	e9 73 ff ff ff       	jmpq   4009f0 <register_tm_clones>

0000000000400a7d <main>:
extern void signal_handler(int signo);
extern void dump(void);
extern void add(void);

int main(int argc, char *argv[])
{
  400a7d:	55                   	push   %rbp
  400a7e:	48 89 e5             	mov    %rsp,%rbp
  400a81:	48 83 ec 10          	sub    $0x10,%rsp
  400a85:	89 7d fc             	mov    %edi,-0x4(%rbp)
  400a88:	48 89 75 f0          	mov    %rsi,-0x10(%rbp)
	signal(SIGSEGV, signal_handler);  /* 为SIGSEGV信号安装新的处理函数 */
  400a8c:	be a2 0b 40 00       	mov    $0x400ba2,%esi
  400a91:	bf 0b 00 00 00       	mov    $0xb,%edi
  400a96:	e8 b5 fe ff ff       	callq  400950 <signal@plt>
	
	add();
  400a9b:	e8 1f 00 00 00       	callq  400abf <add>

	return 0x00;
  400aa0:	b8 00 00 00 00       	mov    $0x0,%eax
}
  400aa5:	c9                   	leaveq 
  400aa6:	c3                   	retq   

0000000000400aa7 <add1>:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

void add1(void)
{
  400aa7:	55                   	push   %rbp
  400aa8:	48 89 e5             	mov    %rsp,%rbp
	int *pTemp = NULL;
  400aab:	48 c7 45 f8 00 00 00 	movq   $0x0,-0x8(%rbp)
  400ab2:	00 
	
	*pTemp = 0x01;  /* 这将导致一个段错误，致使程序崩溃退出 */
  400ab3:	48 8b 45 f8          	mov    -0x8(%rbp),%rax
  400ab7:	c7 00 01 00 00 00    	movl   $0x1,(%rax)
}
  400abd:	5d                   	pop    %rbp
  400abe:	c3                   	retq   

0000000000400abf <add>:
 
void add(void)
{
  400abf:	55                   	push   %rbp
  400ac0:	48 89 e5             	mov    %rsp,%rbp
	add1();
  400ac3:	e8 df ff ff ff       	callq  400aa7 <add1>
}
  400ac8:	5d                   	pop    %rbp
  400ac9:	c3                   	retq   

0000000000400aca <dump>:
#include <execinfo.h> 	/* for backtrace() */

#define BACKTRACE_SIZE   16
 
void dump(void)
{
  400aca:	55                   	push   %rbp
  400acb:	48 89 e5             	mov    %rsp,%rbp
  400ace:	48 81 ec 90 00 00 00 	sub    $0x90,%rsp
	int j, nptrs;
	void *buffer[BACKTRACE_SIZE];
	char **strings;
	
	nptrs = backtrace(buffer, BACKTRACE_SIZE);
  400ad5:	48 8d 45 80          	lea    -0x80(%rbp),%rax
  400ad9:	be 10 00 00 00       	mov    $0x10,%esi
  400ade:	48 89 c7             	mov    %rax,%rdi
  400ae1:	e8 3a fe ff ff       	callq  400920 <backtrace@plt>
  400ae6:	89 85 74 ff ff ff    	mov    %eax,-0x8c(%rbp)
	
	printf("backtrace() returned %d addresses\n", nptrs);
  400aec:	8b 85 74 ff ff ff    	mov    -0x8c(%rbp),%eax
  400af2:	89 c6                	mov    %eax,%esi
  400af4:	bf 88 0c 40 00       	mov    $0x400c88,%edi
  400af9:	b8 00 00 00 00       	mov    $0x0,%eax
  400afe:	e8 2d fe ff ff       	callq  400930 <printf@plt>
 
	strings = backtrace_symbols(buffer, nptrs);
  400b03:	8b 95 74 ff ff ff    	mov    -0x8c(%rbp),%edx
  400b09:	48 8d 45 80          	lea    -0x80(%rbp),%rax
  400b0d:	89 d6                	mov    %edx,%esi
  400b0f:	48 89 c7             	mov    %rax,%rdi
  400b12:	e8 f9 fd ff ff       	callq  400910 <backtrace_symbols@plt>
  400b17:	48 89 85 78 ff ff ff 	mov    %rax,-0x88(%rbp)
	if (strings == NULL) {
  400b1e:	48 83 bd 78 ff ff ff 	cmpq   $0x0,-0x88(%rbp)
  400b25:	00 
  400b26:	75 14                	jne    400b3c <dump+0x72>
		perror("backtrace_symbols");
  400b28:	bf ab 0c 40 00       	mov    $0x400cab,%edi
  400b2d:	e8 3e fe ff ff       	callq  400970 <perror@plt>
		exit(EXIT_FAILURE);
  400b32:	bf 01 00 00 00       	mov    $0x1,%edi
  400b37:	e8 44 fe ff ff       	callq  400980 <exit@plt>
	}
 
	for (j = 0; j < nptrs; j++)
  400b3c:	c7 85 70 ff ff ff 00 	movl   $0x0,-0x90(%rbp)
  400b43:	00 00 00 
  400b46:	eb 3b                	jmp    400b83 <dump+0xb9>
		printf("  [%02d] %s\n", j, strings[j]);
  400b48:	8b 85 70 ff ff ff    	mov    -0x90(%rbp),%eax
  400b4e:	48 98                	cltq   
  400b50:	48 8d 14 c5 00 00 00 	lea    0x0(,%rax,8),%rdx
  400b57:	00 
  400b58:	48 8b 85 78 ff ff ff 	mov    -0x88(%rbp),%rax
  400b5f:	48 01 d0             	add    %rdx,%rax
  400b62:	48 8b 10             	mov    (%rax),%rdx
  400b65:	8b 85 70 ff ff ff    	mov    -0x90(%rbp),%eax
  400b6b:	89 c6                	mov    %eax,%esi
  400b6d:	bf bd 0c 40 00       	mov    $0x400cbd,%edi
  400b72:	b8 00 00 00 00       	mov    $0x0,%eax
  400b77:	e8 b4 fd ff ff       	callq  400930 <printf@plt>
	if (strings == NULL) {
		perror("backtrace_symbols");
		exit(EXIT_FAILURE);
	}
 
	for (j = 0; j < nptrs; j++)
  400b7c:	83 85 70 ff ff ff 01 	addl   $0x1,-0x90(%rbp)
  400b83:	8b 85 70 ff ff ff    	mov    -0x90(%rbp),%eax
  400b89:	3b 85 74 ff ff ff    	cmp    -0x8c(%rbp),%eax
  400b8f:	7c b7                	jl     400b48 <dump+0x7e>
		printf("  [%02d] %s\n", j, strings[j]);
 
	free(strings);
  400b91:	48 8b 85 78 ff ff ff 	mov    -0x88(%rbp),%rax
  400b98:	48 89 c7             	mov    %rax,%rdi
  400b9b:	e8 50 fd ff ff       	callq  4008f0 <free@plt>
}
  400ba0:	c9                   	leaveq 
  400ba1:	c3                   	retq   

0000000000400ba2 <signal_handler>:
 
void signal_handler(int signo)
{
  400ba2:	55                   	push   %rbp
  400ba3:	48 89 e5             	mov    %rsp,%rbp
  400ba6:	48 83 ec 10          	sub    $0x10,%rsp
  400baa:	89 7d fc             	mov    %edi,-0x4(%rbp)
	sprintf(buff,"cat /proc/%d/maps", getpid());
		
	system((const char*) buff);
#endif	
 
	printf("\n=========>>>catch signal %d <<<=========\n", signo);
  400bad:	8b 45 fc             	mov    -0x4(%rbp),%eax
  400bb0:	89 c6                	mov    %eax,%esi
  400bb2:	bf d0 0c 40 00       	mov    $0x400cd0,%edi
  400bb7:	b8 00 00 00 00       	mov    $0x0,%eax
  400bbc:	e8 6f fd ff ff       	callq  400930 <printf@plt>
	
	printf("Dump stack start...\n");
  400bc1:	bf fb 0c 40 00       	mov    $0x400cfb,%edi
  400bc6:	e8 35 fd ff ff       	callq  400900 <puts@plt>
	dump();
  400bcb:	e8 fa fe ff ff       	callq  400aca <dump>
	printf("Dump stack end...\n");
  400bd0:	bf 0f 0d 40 00       	mov    $0x400d0f,%edi
  400bd5:	e8 26 fd ff ff       	callq  400900 <puts@plt>
 
	signal(signo, SIG_DFL); /* 恢复信号默认处理 */
  400bda:	8b 45 fc             	mov    -0x4(%rbp),%eax
  400bdd:	be 00 00 00 00       	mov    $0x0,%esi
  400be2:	89 c7                	mov    %eax,%edi
  400be4:	e8 67 fd ff ff       	callq  400950 <signal@plt>
	raise(signo);           /* 重新发送信号 */
  400be9:	8b 45 fc             	mov    -0x4(%rbp),%eax
  400bec:	89 c7                	mov    %eax,%edi
  400bee:	e8 ed fc ff ff       	callq  4008e0 <raise@plt>
}
  400bf3:	c9                   	leaveq 
  400bf4:	c3                   	retq   
  400bf5:	66 2e 0f 1f 84 00 00 	nopw   %cs:0x0(%rax,%rax,1)
  400bfc:	00 00 00 
  400bff:	90                   	nop

0000000000400c00 <__libc_csu_init>:
  400c00:	41 57                	push   %r15
  400c02:	41 89 ff             	mov    %edi,%r15d
  400c05:	41 56                	push   %r14
  400c07:	49 89 f6             	mov    %rsi,%r14
  400c0a:	41 55                	push   %r13
  400c0c:	49 89 d5             	mov    %rdx,%r13
  400c0f:	41 54                	push   %r12
  400c11:	4c 8d 25 f8 11 20 00 	lea    0x2011f8(%rip),%r12        # 601e10 <__frame_dummy_init_array_entry>
  400c18:	55                   	push   %rbp
  400c19:	48 8d 2d f8 11 20 00 	lea    0x2011f8(%rip),%rbp        # 601e18 <__init_array_end>
  400c20:	53                   	push   %rbx
  400c21:	4c 29 e5             	sub    %r12,%rbp
  400c24:	31 db                	xor    %ebx,%ebx
  400c26:	48 c1 fd 03          	sar    $0x3,%rbp
  400c2a:	48 83 ec 08          	sub    $0x8,%rsp
  400c2e:	e8 75 fc ff ff       	callq  4008a8 <_init>
  400c33:	48 85 ed             	test   %rbp,%rbp
  400c36:	74 1e                	je     400c56 <__libc_csu_init+0x56>
  400c38:	0f 1f 84 00 00 00 00 	nopl   0x0(%rax,%rax,1)
  400c3f:	00 
  400c40:	4c 89 ea             	mov    %r13,%rdx
  400c43:	4c 89 f6             	mov    %r14,%rsi
  400c46:	44 89 ff             	mov    %r15d,%edi
  400c49:	41 ff 14 dc          	callq  *(%r12,%rbx,8)
  400c4d:	48 83 c3 01          	add    $0x1,%rbx
  400c51:	48 39 eb             	cmp    %rbp,%rbx
  400c54:	75 ea                	jne    400c40 <__libc_csu_init+0x40>
  400c56:	48 83 c4 08          	add    $0x8,%rsp
  400c5a:	5b                   	pop    %rbx
  400c5b:	5d                   	pop    %rbp
  400c5c:	41 5c                	pop    %r12
  400c5e:	41 5d                	pop    %r13
  400c60:	41 5e                	pop    %r14
  400c62:	41 5f                	pop    %r15
  400c64:	c3                   	retq   
  400c65:	66 66 2e 0f 1f 84 00 	data32 nopw %cs:0x0(%rax,%rax,1)
  400c6c:	00 00 00 00 

0000000000400c70 <__libc_csu_fini>:
  400c70:	f3 c3                	repz retq 

Disassembly of section .fini:

0000000000400c74 <_fini>:
  400c74:	48 83 ec 08          	sub    $0x8,%rsp
  400c78:	48 83 c4 08          	add    $0x8,%rsp
  400c7c:	c3                   	retq   
